﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.Linq;
using FreightSoft.Models;

namespace FreightSoft.Classes
{   
    public class OzekiSMS
    {
        private Entities db = new Entities();

        public void SendSMS(string receiver, string message)
        {
            if (receiver != null)
            {
                decimal nextId = db.OZEKIMESSAGEOUTs.Max(p => p.ID) + 1;
                db.OZEKIMESSAGEOUTs.Add(new OZEKIMESSAGEOUT { MSG = message, ID = nextId, SENDER="0094727205458", RECEIVER = receiver, MSGTYPE = "SMS:TEXT", STATUS = "send" });
                db.SaveChanges();
            }           
        }
    }
}